#include <stdio.h>
#include <math.h>

//https://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71?tpId=290&tags=&title=&difficulty=0&judgeStatus=0&rp=0&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D290

int main() {
    int min = 0;
    int max = 0;
    scanf("%d%d", &min, &max);
    while (min <= max) {
        int tmp = min;
        int cct = 0;
        int sum = 0;
        for (int i = 1; tmp / 10; i++) {
            cct += tmp % 10 * pow(10, i) / 10;
            tmp /= 10;
            sum += tmp * cct;
        }
        if (sum == min) {
            printf("%d ", sum);
        }
        min++;
    }
    return 0;
}